// @ts-nocheck
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

Vue.config.productionTip = false;
// 插件
const MyPlugin = {
  install(Vue, options) {
    console.log("我是install内的代码");
    // 1. 添加全局方法或属性
    Vue.myGlobalMethod = function() {
      // 逻辑...
      console.log("myGlobalMethod");
    };
    // 4. 添加实例方法
    Vue.prototype.$myMethod = function(methodOptions) {
      // 逻辑...
      console.log("myMethod");
    };
  }
};

// 初始化插件
Vue.use(MyPlugin); // 页面显示"我是install内的代码"
Vue.use(MyPlugin);

Vue.prototype.$alert = function() {
  console.log("$alert");
};

const vm = new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
console.log(vm);
